package com.bayihouse.service.impl;

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bayihouse.mapper.NetobjectMapper;
import com.bayihouse.model.entity.Netobject;
import com.bayihouse.model.vo.NetObjectVO;
import com.bayihouse.service.NetObjectService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Administrator
 * @description 针对表【netobject】的数据库操作Service实现
 * @createDate 2024-09-17 10:28:03
 */
@Service
public class NetObjectServiceImpl extends ServiceImpl<NetobjectMapper, Netobject>
        implements NetObjectService {


    @Override
    public NetObjectVO getNetObjectVO(Netobject netobject) {
        if (netobject == null) {
            return null;
        }
        return NetObjectVO.objToVO(netobject);
    }

    @Override
    public List<NetObjectVO> getAdministerVOList(List<Netobject> netobjectList) {
        if (CollectionUtils.isEmpty(netobjectList)) {
            return new ArrayList<>();
        }
        return netobjectList.stream().map(this::getNetObjectVO).collect(Collectors.toList());
    }
}




